package newTest.test3;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import vo.UserVO;

public class DUserDaoMain extends UserDao {

	@Override
	public Connection getConnection() throws ClassNotFoundException,
			SQLException {
		Class.forName("oracle.jdbc.driver.OracleDriver");
		
		Connection c = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:xe","ksuniry","73031523");
		
		return c ;
	}
	public static void main(String args[]) throws ClassNotFoundException,SQLException{
		

		UserDao DUserDao =  new DUserDaoMain();
		UserVO user = new UserVO();
		
		user.setId("test2");
		user.setName("testNm");
		user.setPassword("testPw");
		
		DUserDao.add(user);
		
		System.out.println("등록성공"+user.getName());
		
		UserVO user2 = new UserVO();
		user2 = DUserDao.get(user.getId());
		
		System.out.println("호출성공 : "+user2.getName());
		
	}

}
